from abc import ABC
import akshare as ak


class StockHistoryInterface(ABC):
    def get(self, symbol, start_time, end_time,
            fields='symbol,open, close, low, high,volume, bob', frequency='1d'):
        pass

class StockHistory_by_Akshare(StockHistoryInterface):
    def get(self, symbol, start_time, end_time,
            fields='symbol, close, low, high,volume, bob', frequency='1d'):
        # 'SZSE.002501'
        print(symbol, start_time, end_time)
        stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol=symbol, period="daily", start_date=start_time, end_date=end_time, adjust="qfq")
        return stock_zh_a_hist_df